package homework.Abstract;

public class AnimalTest {
    public static void main(String[] args) {
        Animal[] animals = new Animal[3];
        animals[0] = new Dog("旺财", 3);
        animals[1] = new Cat("汤姆", 3);
        animals[2] = new Cat("kitty", 3);
        System.out.println("===动物行为测试===");
        for (Animal animal : animals) {
            animal.makeSound();
            animal.displayInfo();
            System.out.println("-----------------");
        }
    }
}
